package com.design.strategy;

/**
 * @Author: ChengLei.Liu
 * @Date: 2020-07-23 16:05
 * @Description:
 */
public class GoOnWorkByPersonAge implements GoOnWorkStrategy {
    @Override
    public void goOnWork(GoOnWork goOnWork) {
        Integer age = goOnWork.getPerson().getAge();
        System.out.println("根据人的年龄去上班策略");
        System.out.println("年龄:"+age);
        if(age>24){
            System.out.println("开车去上班");
        }else{
            System.out.println("走路去上班");
        }
    }
}
